function [PD,r,ErS] = PDdisasters(p,beta,etabar,muC,muD,lambda);

K = Phi(p,beta,etabar,muC,muD,lambda);
if K>1
    error('series does not converge')
end

%price-dividend ratio 
PD = K./(1-K);
ErS = exp(muD)*(1./K).*(1 + p*(exp(-lambda*etabar)-1))-1

r =  1/beta*exp(muC)*(1./(1+p*(exp(etabar)-1)))-1


function Phi =Phi(p,beta,etabar,muC,muD,lambda);


Phi = beta*...
      exp(muD-muC)*...
      (1+p*(exp(-(lambda-1)*etabar)-1));